package zmiddleware

import (
	"gitee.com/youkelike/zlog"
	"github.com/gin-gonic/gin"
)

const UsernameKey = "username"

func Context() gin.HandlerFunc {
	return func(c *gin.Context) {
		c.Set(zlog.KeyRequestID, c.GetString(XRequestIDKey))
		c.Set(zlog.KeyUsername, c.GetString(UsernameKey))
		c.Next()
	}
}
